<template>
  <div
    class="mybtn"
    :class="{ primary: type == 'primary', success: type == 'success' }"
    @click="handlerclick"
  >
    <slot></slot>
  </div>
</template>

<script>
export default {
  props: {
    // text: {
    //   type: String,
    //   required: true
    // }
    type: {
      type: String,
    },
  },
  methods: {
    handlerclick(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.mybtn {
  width: 90%;
  margin: 0 auto;
  height: 40/540 * 100vw;
  line-height: 40/540 * 100vw;
  text-align: center;
  font-weight: bold;
  color: #000;
  border: 1px solid #ccc;
  border-radius: 20/540 * 100vw;
}
.primary {
  color: #fff;
  border: 1px solid blue;
  background-color: blue;
}
.success {
  color: #f4d5ca;
  border: 1px solid red;
  background-color: #cc3300;
}
</style>